package com.guiji.text2video.fastvideo.utils;

public class Enums {

    /**
     * Job运行状态
     *
     * @author scl
     * @date 2021-6-10
     */
    public static enum JobSign {

        SUCCESS("1", "完成"),
        RUNNING("0", "正在运行"),
        NLP_FAILED("-1", "NLP失败,找不到资源"),
        TTS_FAILED("-2", "TTS失败，请求超时"),
        COM_FAILED("-3", "合成失败"),
        CHECk_FAILED("-4", "检查失败"),
        UNCOMMITTED("-5", "Job没有提交"),
        QUEUED_NLP("-6", "排队NLP"),
        RUN_NLP("-7", "正在执行NLP服务"),
        QUEUED_TTS("-8", "排队TTS"),
        RUN_TTS("-9", "正在TTS"),
        QUEUED_COM("-10", "排队合成服务"),
        RUN_COM("-11", "正在执行合成服务"),
        ENCODE_ERROR("-12", "非UTF-8编码"),
        TYPE_ERROR("-13", "非文本类型文件"),
        COUNT_ERROR("-14", "文本长度超过5000或者小于1");

        private JobSign(String key, String value) {
            this.key = key;
            this.value = value;
        }
        private final String key;
        private final String value;

        public String getValue() {
            return value;
        }

        public String getKey() {
            return key;
        }


    }

    /**
     * 数值性管理
     *
     * @author scl
     * @date 2021-6-10
     */
    public static enum numSign {

        contentSize(5000, "单文本文本长度"),
        zero(0, "长度零"),
        one(1, "长度1"),
        len200(200, "长度200"),
        len404(404, "长度404"),
        len256(256, "长度256"),
        batchSize(20, "批量接口文件数"),
        fileSize(100000000,"zip文件大小100M以内"),
        NLPTimeOut(300,"nlp链接超时单位秒"),
        NLPReadTimeOut(300,"nlp读取超时单位秒"),
        TTSTimeOut(3600,"TTS超时上线单位秒"),
        TTSSleepTime(1000,"等待时间单位毫秒");

        private numSign(int key, String value) {
            this.key = key;
            this.value = value;
        }
        private final int key;
        private final String value;

        public String getValue() {
            return value;
        }
        public int getKey() {
            return key;
        }


    }
    /**
     * http错误码，错误提示
     *
     * @author scl
     * @date 2021-6-10
     */
    public static enum httpCode {

        ERROR_01("400_00_01", "title和content都不能为空"),
        ERROR_02("400_00_02", "文章内容最多5000字符"),
        ERROR_03("400_00_03", "批量接口文件数"),
        ERROR_04("400_00_04", "zip或者文件格式不正确"),
        ERROR_05("400_00_05", "status不为1，NLP服务异常"),
        ERROR_06("400_00_06", "http状态非200"),
        ERROR_07("400_00_07", "files不能为空"),
        ERROR_08("400_00_08", "文本超过20个，请使用压缩接口"),
        ERROR_09("400_00_09", "文件过大"),
        ERROR_10("400_00_10", "taskId不能为空"),
        ERROR_16("400_00_16", "当前任务正在校验阶段"),
        ERROR_17("400_00_17", "任务重试接口失败"),
        ERROR_18("400_00_18", "多任务失败"),
        ERROR_19("400_00_19", "当前Job执行TTS任务超时3600s,且执行完："),
        SUCCESS("200_00_01", "合成成功");


        private httpCode(String key, String value) {
            this.key = key;
            this.value = value;
        }
        private final String key;
        private final String value;

        public String getValue() {
            return value;
        }
        public String getKey() {
            return key;
        }

    }

}
